package com.jjsc.order.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jjsc.common.core.annotation.Excel;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * 订单
 * @TableName order_info
 */
@TableName(value ="order_info")
@Schema(description = "订单表")
@Data
public class OrderInfo {
    /**
     * id
     */
    @Schema(description = "id")
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 客户id
     */
    @Schema(description = "客户id")
    private Long userId;

    /**
     * 昵称
     */
    @Schema(description = "昵称")
    @Excel(name = "昵称")
    private String nickName;

    /**
     * 订单号
     */
    @Schema(description = "订单号")
    @Excel(name = "订单号")
    private String orderNo;

    /**
     * 使用的优惠券
     */
    @Schema(description = "使用的优惠券")
    private Long couponId;

    /**
     * 订单总额
     */
    @Schema(description = "订单总额")
    @Excel(name = "订单总额")
    private BigDecimal totalAmount;

    /**
     * 优惠券
     */
    @Schema(description = "优惠券")
    private BigDecimal couponAmount;

    /**
     * 原价金额
     */
    @Schema(description = "原价金额")
    @Excel(name = "原价金额")
    private BigDecimal originalTotalAmount;

    /**
     * 运费
     */
    @Schema(description = "运费")
    @Excel(name = "运费")
    private BigDecimal feightFee;

    /**
     * 订单状态【0->待付款；1->待发货；2->已发货；3->待用户收货，已完成；-1->已取消】
     */
    @Schema(description = "订单状态【0->待付款；1->待发货；2->已发货；3->待用户收货，已完成；-1->已取消】")
    @Excel(name = "订单状态【0->待付款；1->待发货；2->已发货；3->待用户收货，已完成；-1->已取消】")
    private Integer orderStatus;

    /**
     * 收货人姓名
     */
    @Schema(description = "收货人姓名")
    @Excel(name = "收货人姓名")
    private String receiverName;

    /**
     * 收货人电话
     */
    @Schema(description = "收货人电话")
    @Excel(name = "收货人电话")
    private String receiverPhone;

    /**
     * 收货人地址标签
     */
    @Schema(description = "收货人地址标签")
    @Excel(name = "收货人地址标签")
    private String receiverTagName;

    /**
     * 省份/直辖市
     */
    @Schema(description = "省份/直辖市")
    @Excel(name = "省份/直辖市")
    private String receiverProvince;

    /**
     * 城市
     */
    @Schema(description = "城市")
    @Excel(name = "城市")
    private String receiverCity;

    /**
     * 区/县
     */
    @Schema(description = "区/县")
    @Excel(name = "区/县")
    private String receiverDistrict;

    /**
     * 详细地址
     */
    @Schema(description = "详细地址")
    @Excel(name = "详细地址")
    private String receiverAddress;

    /**
     * 支付时间
     */
    @Schema(description = "支付时间")
    @Excel(name = "支付时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date paymentTime;

    /**
     * 发货时间
     */
    @Schema(description = "发货时间")
    @Excel(name = "发货时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date deliveryTime;

    /**
     * 确认收货时间
     */
    @Schema(description = "确认收货时间")
    @Excel(name = "确认收货时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date receiveTime;

    /**
     * 取消订单时间
     */
    @Schema(description = "取消订单时间")
    @Excel(name = "取消订单时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date cancelTime;

    /**
     * 取消订单原因
     */
    @Schema(description = "取消订单原因")
    @Excel(name = "取消订单原因")
    private String cancelReason;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    @Excel(name = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 创建者
     */
    @Schema(description = "创建者")
    @Excel(name = "创建者")
    private String createBy;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    @Excel(name = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 更新者
     */
    @Schema(description = "更新者")
    @Excel(name = "更新者")
    private String updateBy;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @Schema(description = "删除标志（0代表存在 2代表删除）")
    @TableLogic
    private String delFlag;

    /**
     * 订单备注
     */
    @Schema(description = "订单备注")
    @Excel(name = "订单备注")
    private String remark;

    /**
     * 订单项信息
     */
    @TableField(exist = false)
    @Schema(description = "订单项信息")
    private List<OrderItem> orderItemList;

}